<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QWebElementCollection Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QWebElementCollection Class Reference<br /><sup><sup>[<a href="qtwebkit.html">QtWebKit</a> module]</sup></sup></h1><p>The QWebElementCollection class represents a collection of web
elements. <a href="#details">More...</a></p>

<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qwebelementcollection.html#QWebElementCollection">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qwebelementcollection.html#QWebElementCollection-2">__init__</a></b> (<i>self</i>, QWebElement&#160;<i>contextElement</i>, QString&#160;<i>query</i>)</li><li><div class="fn" /><b><a href="qwebelementcollection.html#QWebElementCollection-3">__init__</a></b> (<i>self</i>, QWebElementCollection)</li><li><div class="fn" /><b><a href="qwebelementcollection.html#append">append</a></b> (<i>self</i>, QWebElementCollection&#160;<i>collection</i>)</li><li><div class="fn" />QWebElement <b><a href="qwebelementcollection.html#at">at</a></b> (<i>self</i>, int&#160;<i>i</i>)</li><li><div class="fn" />int <b><a href="qwebelementcollection.html#count">count</a></b> (<i>self</i>)</li><li><div class="fn" />QWebElement <b><a href="qwebelementcollection.html#first">first</a></b> (<i>self</i>)</li><li><div class="fn" />QWebElement <b><a href="qwebelementcollection.html#last">last</a></b> (<i>self</i>)</li><li><div class="fn" />list-of-QWebElement <b><a href="qwebelementcollection.html#toList">toList</a></b> (<i>self</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />QWebElementCollection <b><a href="qwebelementcollection.html#__add__">__add__</a></b> (<i>self</i>, QWebElementCollection&#160;<i>other</i>)</li><li><div class="fn" />QWebElement <b><a href="qwebelementcollection.html#__getitem__">__getitem__</a></b> (<i>self</i>, int&#160;<i>i</i>)</li><li><div class="fn" />QWebElementCollection <b><a href="qwebelementcollection.html#__iadd__">__iadd__</a></b> (<i>self</i>, QWebElementCollection&#160;<i>other</i>)</li><li><div class="fn" /> <b><a href="qwebelementcollection.html#__len__">__len__</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QWebElementCollection class represents a collection of web
elements.</p>
<p>Elements in a document can be selected using <a href="qwebelement.html#findAll">QWebElement.findAll</a>() or using the
<a href="qwebelement.html">QWebElement</a> constructor. The
collection is composed by choosing all elements in the document
that match a specified CSS selector expression.</p>
<p>The number of selected elements is provided through the <a href="qwebelementcollection.html#count">count</a>() property. Individual
elements can be retrieved by index using <a href="qwebelementcollection.html#at">at</a>().</p>
<p>It is also possible to iterate through all elements in the
collection using Qt's foreach macro:</p>
<pre class="cpp">
 <span class="type">QWebElementCollection</span> collection <span class="operator">=</span> document<span class="operator">.</span>findAll(<span class="string">"p"</span>);
 <a href="qtcore.html#foreach">foreach</a> (<span class="type"><a href="qwebelement.html">QWebElement</a></span> paraElement<span class="operator">,</span> collection) {
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 }
</pre><hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QWebElementCollection" />QWebElementCollection.__init__ (<i>self</i>)</h3><p>Constructs an empty collection.</p>


<h3 class="fn"><a name="QWebElementCollection-2" />QWebElementCollection.__init__ (<i>self</i>, <a href="qwebelement.html">QWebElement</a>&#160;<i>contextElement</i>, QString&#160;<i>query</i>)</h3><p>Constructs a collection of elements from the list of child
elements of <i>contextElement</i> that match the specified CSS
selector <i>query</i>.</p>


<h3 class="fn"><a name="QWebElementCollection-3" />QWebElementCollection.__init__ (<i>self</i>, <a href="qwebelementcollection.html">QWebElementCollection</a>)</h3><p>Constructs a copy of <i>other</i>.</p>


<h3 class="fn"><a name="append" />QWebElementCollection.append (<i>self</i>, <a href="qwebelementcollection.html">QWebElementCollection</a>&#160;<i>collection</i>)</h3><p>Extends the collection by appending all items of
<i>other</i>.</p>
<p>The resulting collection may include duplicate elements.</p>
<p><b>See also</b> <a href="qwebelementcollection.html#operator-2b-eq">operator+=</a>().</p>


<h3 class="fn"><a name="at" /><a href="qwebelement.html">QWebElement</a> QWebElementCollection.at (<i>self</i>, int&#160;<i>i</i>)</h3><p>Returns the element at index position <i>i</i> in the
collection.</p>


<h3 class="fn"><a name="count" />int QWebElementCollection.count (<i>self</i>)</h3><p>Returns the number of elements in the collection.</p>


<h3 class="fn"><a name="first" /><a href="qwebelement.html">QWebElement</a> QWebElementCollection.first (<i>self</i>)</h3><p>Returns the first element in the collection.</p>
<p><b>See also</b> <a href="qwebelementcollection.html#last">last</a>(), <a href="qwebelementcollection.html#operator-5b-5d">operator[]</a>(),
<a href="qwebelementcollection.html#at">at</a>(), and <a href="qwebelementcollection.html#count">count</a>().</p>


<h3 class="fn"><a name="last" /><a href="qwebelement.html">QWebElement</a> QWebElementCollection.last (<i>self</i>)</h3><p>Returns the last element in the collection.</p>
<p><b>See also</b> <a href="qwebelementcollection.html#first">first</a>(), <a href="qwebelementcollection.html#operator-5b-5d">operator[]</a>(),
<a href="qwebelementcollection.html#at">at</a>(), and <a href="qwebelementcollection.html#count">count</a>().</p>


<h3 class="fn"><a name="toList" />list-of-QWebElement QWebElementCollection.toList (<i>self</i>)</h3><p>Returns a <a href="qlist.html">QList</a> object with the
elements contained in this collection.</p>


<h3 class="fn"><a name="__add__" /><a href="qwebelementcollection.html">QWebElementCollection</a> QWebElementCollection.__add__ (<i>self</i>, <a href="qwebelementcollection.html">QWebElementCollection</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__getitem__" /><a href="qwebelement.html">QWebElement</a> QWebElementCollection.__getitem__ (<i>self</i>, int&#160;<i>i</i>)</h3><h3 class="fn"><a name="__iadd__" /><a href="qwebelementcollection.html">QWebElementCollection</a> QWebElementCollection.__iadd__ (<i>self</i>, <a href="qwebelementcollection.html">QWebElementCollection</a>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__len__" /> QWebElementCollection.__len__ (<i>self</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>